﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using WPFExcelReport.Helpers;
namespace WPFExcelReport
{
    public partial class TSMCO02
    {
        #region ==AUF===========
        public static readonly DependencyProperty AUFProperty = DependencyProperty.Register("AUF",
            typeof(string), typeof(TSMCO02),
            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnAUFChanged));
        public string AUF
        {
            get
            {
                return (string)GetValue(AUFProperty);
            }
            set
            {
                SetValue(AUFProperty, value);
            }
        }
        private static void OnAUFChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as TSMCO02;
            if (src != null)
            {
                src.AUF = (string)e.NewValue;
            }
        }
        #endregion
        
       
        public TSMCO02()
        {
            MV = new VICC_ABPOS_MCO(); 
            InitializeComponent(); 
        }
        string LastAUF = "";
        public void Load()
        {
            if (LastAUF == AUF)
                return;
            LastAUF = AUF;
            DataSet SResult = ((VICC_ABPOS_MCO)MV).LoadMCO(AUF);
            MergeData(SResult);
        }
    }
}
